<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.blockchain.common.enums.ZrState"%>
<%@page import="com.blockchain.console.servlets.trading.xlb.XlbList"%>
<%@page import="com.blockchain.console.servlets.trading.xlb.AddXlb"%>
<%@page import="com.blockchain.common.enums.IsPass"%>
<%@page import="com.blockchain.common.enums.CoinType"%>
<html>
<head>
<%@include file="/WEB-INF/include/meta.jsp"%>
<%@include file="/WEB-INF/include/style.jsp"%>
</head>
<%
CURRENT_CATEGORY="JYGL";
CURRENT_SUB_CATEGORY="XLBGL";
%>
<body>
	<%@include file="/WEB-INF/include/header.jsp"%>
	<div class="w_main">
	<div class="main clearfix">  
    <div class="wrap">
        <div class="r_main">
            <div class="home_main">
            	<div class="box box1 mb15">
                	<div class="atil">
                    	<h3>添加虚拟币</h3>
                  </div>
                    <div class="con">
                    <div class="clear"></div>
                    <form action="<%=controller.getURI(request, AddXlb.class)%>" method="post" enctype="multipart/form-data" onsubmit="return checkImage();" class="form1">
                    <ul class="cell yw_jcxx">
                    <li>
                        <div class="til"><span class="red">&nbsp;</span></div>
                        <div class="info orange">
                        <%StringHelper.filterHTML(out, controller.getPrompt(request, response, PromptLevel.ERROR));%>
                        </div>
                        <div class="clear"></div>
                    </li>
                     <li>
                        <div class="til"><span class="red">*</span>英文简称：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required max-length-10" name="ywjc" value="<%StringHelper.filterHTML(out,request.getParameter("ywjc"));%>" />
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>英文名：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required max-length-20" name="ywm" value="<%StringHelper.filterHTML(out,request.getParameter("ywm"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>中文名：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required max-length-20" name="zwm" value="<%StringHelper.filterHTML(out,request.getParameter("zwm"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <%-- <li>
                        <div class="til"><span class="red">*</span>中文名（繁体）：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required max-length-20" name="coinNameTw" value="<%StringHelper.filterHTML(out,request.getParameter("coinNameTw"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li> --%>
                    <li>
                        <div class="til"><span class="red">*</span>钱包服务器ip：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser  " name="wallet_ip" value="<%StringHelper.filterHTML(out,request.getParameter("wallet_ip"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
       
                    <li>
                        <div class="til"><span class="red">*</span>钱包服务器端口：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser  " name="wallet_port" value="<%StringHelper.filterHTML(out,request.getParameter("wallet_port"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>钱包服务器用户名：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser  " name="wallet_username" value="<%StringHelper.filterHTML(out,request.getParameter("wallet_username"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>钱包服务器密码：</div>
                        <div class="info orange">
                        	<input type="password" class="text yhgl_ser  " name="wallet_password" value="<%StringHelper.filterHTML(out,request.getParameter("wallet_password"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>转出最小限制：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="zc_zx" value="<%StringHelper.filterHTML(out,request.getParameter("zc_zx"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                    <li>
                        <div class="til"><span class="red">*</span>转出最大限制：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="zc_zd" value="<%StringHelper.filterHTML(out,request.getParameter("zc_zd"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                    <li>
                        <div class="til"><span class="red">*</span>最低转出手续费：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="zd_sxf" value="<%StringHelper.filterHTML(out,request.getParameter("zd_sxf"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                     <li>
                        <div class="til"><span class="red">*</span>转出最高手续费率：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="zg_sxf" value="<%StringHelper.filterHTML(out,request.getParameter("zg_sxf"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                    <li>
                        <div class="til"><span class="red">*</span>热钱包地址：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="rqbdz" value="<%StringHelper.filterHTML(out,request.getParameter("rqbdz"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                    <li>
                        <div class="til"><span class="red">*</span>热钱包私钥：</div>
                        <div class="info orange">
                        	<input type="password" class="text yhgl_ser required" name="rqbsy" value="<%StringHelper.filterHTML(out,request.getParameter("rqbsy"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                     
                    <li>
                        <div class="til"><span class="red">*</span>冷钱包地址：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="lqbdz" value="<%StringHelper.filterHTML(out,request.getParameter("lqbdz"));%>"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                    <li>
                        <div class="til"><span class="red">*</span>大于多少自动转入：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser required " name="dy_zdzr" value="<%StringHelper.filterHTML(out,request.getParameter("dy_zdzr"));%>"/>
                        	 <p tip>比特系列一定要大于手续费</p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                     <li>
                        <div class="til"><span class="red">*</span>推出日期：</div>
                        <div class="info orange">
                        	<input type="text" readonly="readonly" id="datepicker1" name="tcrq" class="text yhgl_ser  required" value="<%StringHelper.filterHTML(out, ObjectHelper.convert(request.getAttribute("tcrq"), String.class));%>"/>
                        	<p tip></p>
                        	<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                     <li>
                        <div class="til"><span class="red">*</span>币种类型：</div>
                        <div class="info orange">
                        	<select name="coin_type" class="yhgl_sel">
                                <%for (CoinType s : CoinType.values()) {%>
								<option value="<%=s.name()%>" <%if (s.name().equals(request.getParameter("coin_type"))) {%> selected="selected" <%}%>><%=s.getName()%></option>
								<%}%>
                            </select>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red"></span>方法ID：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser  " name="methodId" "/>
                        	 <p tip>以太坊</p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red"></span>合约地址：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser  " name="contractAddress" />
                        	 <p tip>以太坊</p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red"></span>单位：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser  " name="unit" />
                        	 <p tip>以太坊(如1G wei = 1000000000)</p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red"></span>超过多少转入热钱包：</div>
                        <div class="info orange">
                        	<input type="text" class="text yhgl_ser " name="tranHotWallet"/>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>是否自动转入冷钱包：</div>
                        <div class="info orange">
                        	<select name="sfzdzrlqb" class="yhgl_sel">
                                <%for (IsPass s : IsPass.values()) {%>
								<option value="<%=s.name()%>" <%if (s.name().equals(request.getParameter("sfzdzrlqb"))) {%> selected="selected" <%}%>><%=s.getName()%></option>
								<%}%>
                            </select>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                     <li>
                        <div class="til"><span class="red">*</span>是否正常转入：</div>
                        <div class="info orange">
                        	<select name="zc_zr" class="yhgl_sel">
                                <%for (ZrState s : ZrState.values()) {%>
								<option value="<%=s.name()%>" <%if (s.name().equals(request.getParameter("zc_zr"))) {%> selected="selected" <%}%>><%=s.getName()%></option>
								<%}%>
                            </select>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
                    <li>
                        <div class="til"><span class="red">*</span>是否正常转出：</div>
                        <div class="info orange">
                        	<select name="zc_zc" class="yhgl_sel">
                                <%for (IsPass s : IsPass.values()) {%>
								<option value="<%=s.name()%>" <%if (s.name().equals(request.getParameter("zc_zc"))) {%> selected="selected" <%}%>><%=s.getName()%></option>
								<%}%>
                            </select>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>币种描述-简体</div>
                        <div class="info orange">
                        	<textarea name="coinDesc" cols="100" rows="5"><%StringHelper.filterHTML(out,request.getParameter("coinDesc"));%></textarea>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <li>
                        <div class="til"><span class="red">*</span>币种描述-英文</div>
                        <div class="info orange">
                        	<textarea name="coinDescEn" cols="100" rows="5"><%StringHelper.filterHTML(out,request.getParameter("coinDescEn"));%></textarea>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    <%-- <li>
                        <div class="til"><span class="red">*</span>币种描述-繁体</div>
                        <div class="info orange">
                        	<textarea name="coinDescTw" cols="100" rows="5"><%StringHelper.filterHTML(out,request.getParameter("coinDescTw"));%></textarea>
                        	 <p tip></p>
							<p errortip class="" style="display: none"></p>
                        </div>
                        <div class="clear"></div>
                    </li> --%>
                     <li>
                        <div class="til"><span class="red">*</span>图标：</div>
                        <div class="info orange">
                        <p class="mb10"><input  type="file" name="image" value=""></p>
                        <p id="errorImage">&nbsp;</p>
                        </div>
                        <div class="clear"></div>
                    </li>
                    
               		</ul>
                    <div class="tc w220 pt20"><button type="submit" class="btn4 mr30 sumbitForme" style="cursor: pointer;" fromname="form1">确认</button>
                    	<a href="<%=controller.getURI(request, XlbList.class) %>" class="btn4">返回</a>
                    </div>
                	<div class="clear"></div>
                    </form>
                  </div>
                </div>
              <div class="box2 clearfix"></div>
            </div>
        </div>   
    </div>
 	<%@include file="/WEB-INF/include/left.jsp" %>
	</div>
	</div>
	<%@include file="/WEB-INF/include/footer.jsp"%>
	<%@include file="/WEB-INF/include/script.jsp"%> 
	<script type="text/javascript" src="<%=controller.getStaticPath(request)%>/js/validation.js"></script>
	<%@include file="/WEB-INF/include/datepicker.jsp"%>
	<script type="text/javascript">
	$(function() {
		/* setTimeout(function() {console.log($("textarea[name='coinDescEn']").val());},1000); */
		$("#datepicker1").datepicker({inline: true});
	    $('#datepicker1').datepicker('option', {dateFormat:'yy-mm-dd'});
	    $("#datepicker1").datepicker("setDate", "<%StringHelper.filterHTML(out, ObjectHelper.convert(request.getAttribute("tcrq"), String.class));%>");
	});
	
	function checkImage(){
		var suffix = $("input:file").val();
		if('' == suffix || suffix == null || suffix.length == 0){
			$("#errorImage").addClass("red");
			$("#errorImage").html("您还没有选择图片");	
			return false;
		}
		var img = ['jpg','png','jpeg','gif','ico'];
		for(var i=0; i<img.length; i++){
			if(suffix.length > img[i].length && img[i] == suffix.substring(suffix.length-img[i].length)){
				$("#errorImage").removeClass("red");
				$("#errorImage").html("&nbsp;");
				return true;
			}
		}
		$("#errorImage").addClass("red");
		$("#errorImage").html("您插入的图片格式不正确");	
		return false;
	}
	
	
	
	</script>
</body>
</html>